﻿@{
    WebSecurity.RequireAuthenticatedUser();
    Layout = "~/_SiteLayout.cshtml";
    Page.Region = RefDataManager.GetRegionLkUpVal();
    Page.IDType = RefDataManager.GetIDTypeLkUpVal();
    Page.Title="Downloads";
    
    //get all files from the content folder
    //Activation,Delivery,Printing,CashCash
    
    string[] activation = Directory.GetFiles(Server.MapPath("~/Content/Activation/"));
    string[] delivery = Directory.GetFiles(Server.MapPath("~/Content/Delivery/"));
    string[] printing = Directory.GetFiles(Server.MapPath("~/Content/Printing/"));
    
     Array.Reverse(activation);
     Array.Reverse(delivery);
     Array.Reverse(printing);
   
}
<style>
    .download{
        float:left;
     margin:5px
    }
</style>
<div style="margin:auto;">
<div class="download">
<fieldset>
    <legend>Activation</legend>
     @foreach(var s in activation){
        string filename = Path.GetFileName(s);
        <p><a href="@Href("~/Content/Activation/"+@filename)">@filename</a></p>
    }
</fieldset>
</div>
<div class="download">
<fieldset>
    <legend>Delivery</legend>
     @foreach(var s in delivery){
        string filename = Path.GetFileName(s);
        <p><a href="@Href("~/Content/Delivery/"+@filename)">@filename</a></p>
    }
</fieldset>
</div>
<div class="download">
<fieldset>
    <legend>Printing</legend>
     @foreach(var s in printing){
        string filename = Path.GetFileName(s);
        <p><a href="@Href("~/Content/Printing/"+@filename)">@filename</a></p>
    }
</fieldset>
</div>    
    </div>